package com.juneyao.bigdata.service;

import com.juneyao.bigdata.domain.*;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.springframework.data.elasticsearch.core.query.SearchQuery;

import java.util.List;

/**
 * @author quanbiao
 * @date 2018-06-28
 * es查询接口
 */
public interface ElasticSearchService {

    /**
     * 根据插入的参数，获取用户的id，作为rowkey去hbase检索
     * @param groupPeopleVO
     * @return
     */
    PageValueCount queryUserIdsForPage(GroupPeopleVO groupPeopleVO);

    /**
     * 获取集合人数
     * @param peopleGroupId
     * @return
     */
    PeopleGroup peopleGroupSum(PeopleGroupId peopleGroupId);

    /**
     * 根据集合ids和会员和微信标识获取build
     * @param crowdIdStr
     * @param memberFlag
     * @param blockFlag
     * @param weiChatFlag
     * @return
     */
    BoolQueryBuilder getBoolQueryBuilder(String crowdIdStr, String memberFlag, String blockFlag, String weiChatFlag);

    /**
     * 根据插叙条件获取用户id集合，用于发送
     * @param boolQueryBuilder
     * @return
     */
    List<String> getUserIdsForAction(BoolQueryBuilder boolQueryBuilder, int pageNum, int pageSize);

    /**
     * 根据查询条件获取总记录数
     * @param searchQuery
     * @return
     */
    long searchCount(SearchQuery searchQuery);


}
